package com.molin.threadTest.threadTools.countDownLatchTest;

import java.util.concurrent.CountDownLatch;

public class ChildThread3 extends Thread{
    private CountDownLatch countDownLatch;
    public ChildThread3(CountDownLatch countDownLatch) {
        this.countDownLatch=countDownLatch;
    }

    @Override
    public void run() {
        //吃饺子
        for (int i = 1; i < 18; i++) {
            System.out.println(Thread.currentThread().getName()+"在吃饺子,"+"已经吃了"+i+"个");
        }
        //告诉妈妈吃完了
        countDownLatch.countDown();
    }
}
